package com.mzy.linear_struct.hot100.双指针;

/**
 * @Author: mizy3
 * @Date: 2024/08/10/下午8:33
 * @Description:
 */
public class Pro283移动零 {

    public void moveZeroes(int[] nums) {

        int l = 0;
        int r = 0;
        while (r < nums.length){
            if(nums[r] != 0) {
                int temp = nums[r];
                nums[r] = nums[l];
                nums[l] = temp;
                l++;
            }
            r++;
        }
    }
}

















